// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.util;

import java.util.function.Function;

public class PooledArrayObject<T> extends PooledObject {
    private T[] m_array = null;

    public T[] array() {
        return this.m_array;
    }

    public int length() {
        return this.m_array.length;
    }

    public T get(int _int) {
        return this.m_array[_int];
    }

    public void set(int _int, T object) {
        this.m_array[_int] = (T)object;
    }

    protected void initCapacity(int _int, Function<Integer, T[]> function) {
        if (this.m_array == null || this.m_array.length != _int) {
            this.m_array = (T[])((Object[])function.apply(_int));
        }
    }

    public boolean isEmpty() {
        return this.m_array == null || this.m_array.length == 0;
    }
}
